#!/usr/bin/python
# -*-coding:UTF-8 -*-

# ========================
# @Time  : 2021/2/2
# @Author: Sunny
# ========================
"""
优化方案
"""
from functools import  lru_cache


@lru_cache(maxsize=128)   #递归函数缓存装饰器，maxsize设置最大的缓存数量

def func(n):
    if n ==1 or n ==2:
        return 1
    else:
        res = func(n-2)+func(n-1)
        return res

res = func(500)
print(res)
